using System;
using System.Collections.Generic;
using System.Text;

namespace Mud.Server
{
    /// <summary>
    /// Utility class for creating and managing ObjectIds
    /// </summary>
    public class ObjectIdManager
    {

        private int _counter;

        public int GetNextId()
        {
			int newId = System.Threading.Interlocked.Increment(ref _counter);
			if (newId == int.MaxValue)
				throw new InvalidOperationException("IDs have been exhausted.");
			return newId;
        }
    }
}
